package ec.linde.persistencia.entidades;

// Generated 07-ago-2014 12:54:27 by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ProdConceptos generated by hbm2java
 */
@Entity
@Table(name = "prod_conceptos", schema = "productividad")
public class ProdConceptos implements java.io.Serializable {

	private int concId;
	private ProdConfigBasPresupues prodConfigBasPresupues;
	private String concNombre;
	private String concUnidad;
	private String concNotaConcepto;
	private int concRubro;
	private Set<ProdPartidasConceptos> prodPartidasConceptoses = new HashSet<ProdPartidasConceptos>(
			0);
	private Set<ProdConceptosMateriales> prodConceptosMaterialeses = new HashSet<ProdConceptosMateriales>(
			0);
	private Set<ProdConceptTransportes> prodConceptTransporteses = new HashSet<ProdConceptTransportes>(
			0);
	private Set<ProdOtrosDirectos> prodOtrosDirectoses = new HashSet<ProdOtrosDirectos>(
			0);
	private Set<ProdConceptosPersonal> prodConceptosPersonals = new HashSet<ProdConceptosPersonal>(
			0);
	private Set<ProdConceptosEquipos> prodConceptosEquiposes = new HashSet<ProdConceptosEquipos>(
			0);

	public ProdConceptos() {
	}

	public ProdConceptos(int concId,int concRubro, String concNombre, String concUnidad) {
		this.concId = concId;
		this.concNombre = concNombre;
		this.concUnidad = concUnidad;
		this.concRubro=concRubro;
	}

	public ProdConceptos(int concId,
			ProdConfigBasPresupues prodConfigBasPresupues, String concNombre,
			String concUnidad, String concNotaConcepto,
			Set<ProdPartidasConceptos> prodPartidasConceptoses,
			Set<ProdConceptosMateriales> prodConceptosMaterialeses,
			Set<ProdConceptTransportes> prodConceptTransporteses,
			Set<ProdOtrosDirectos> prodOtrosDirectoses,
			Set<ProdConceptosPersonal> prodConceptosPersonals,
			Set<ProdConceptosEquipos> prodConceptosEquiposes) {
		this.concId = concId;
		this.prodConfigBasPresupues = prodConfigBasPresupues;
		this.concNombre = concNombre;
		this.concUnidad = concUnidad;
		this.concNotaConcepto = concNotaConcepto;
		this.prodPartidasConceptoses = prodPartidasConceptoses;
		this.prodConceptosMaterialeses = prodConceptosMaterialeses;
		this.prodConceptTransporteses = prodConceptTransporteses;
		this.prodOtrosDirectoses = prodOtrosDirectoses;
		this.prodConceptosPersonals = prodConceptosPersonals;
		this.prodConceptosEquiposes = prodConceptosEquiposes;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "conc_id", nullable = false)
	public int getConcId() {
		return this.concId;
	}

	public void setConcId(int concId) {
		this.concId = concId;
	}

	
	@ManyToOne//(fetch = FetchType.LAZY)
	@JoinColumn(name = "bapr_id")
	public ProdConfigBasPresupues getProdConfigBasPresupues() {
		return this.prodConfigBasPresupues;
	}

	public void setProdConfigBasPresupues(
			ProdConfigBasPresupues prodConfigBasPresupues) {
		this.prodConfigBasPresupues = prodConfigBasPresupues;
	}

	@Column(name = "conc_nombre", nullable = false)
	public String getConcNombre() {
		return this.concNombre;
	}

	public void setConcNombre(String concNombre) {
		this.concNombre = concNombre;
	}

	@Column(name = "conc_unidad", nullable = false)
	public String getConcUnidad() {
		return this.concUnidad;
	}

	public void setConcUnidad(String concUnidad) {
		this.concUnidad = concUnidad;
	}

	@Column(name = "conc_nota_concepto")
	public String getConcNotaConcepto() {
		return this.concNotaConcepto;
	}

	public void setConcNotaConcepto(String concNotaConcepto) {
		this.concNotaConcepto = concNotaConcepto;
	}
	@Column(name = "conc_rubro", nullable = false)
	public int getConcRubro() {
		return concRubro;
	}

	public void setConcRubro(int concRubro) {
		this.concRubro = concRubro;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdPartidasConceptos> getProdPartidasConceptoses() {
		return this.prodPartidasConceptoses;
	}

	public void setProdPartidasConceptoses(
			Set<ProdPartidasConceptos> prodPartidasConceptoses) {
		this.prodPartidasConceptoses = prodPartidasConceptoses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdConceptosMateriales> getProdConceptosMaterialeses() {
		return this.prodConceptosMaterialeses;
	}

	public void setProdConceptosMaterialeses(
			Set<ProdConceptosMateriales> prodConceptosMaterialeses) {
		this.prodConceptosMaterialeses = prodConceptosMaterialeses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdConceptTransportes> getProdConceptTransporteses() {
		return this.prodConceptTransporteses;
	}

	public void setProdConceptTransporteses(
			Set<ProdConceptTransportes> prodConceptTransporteses) {
		this.prodConceptTransporteses = prodConceptTransporteses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdOtrosDirectos> getProdOtrosDirectoses() {
		return this.prodOtrosDirectoses;
	}

	public void setProdOtrosDirectoses(
			Set<ProdOtrosDirectos> prodOtrosDirectoses) {
		this.prodOtrosDirectoses = prodOtrosDirectoses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdConceptosPersonal> getProdConceptosPersonals() {
		return this.prodConceptosPersonals;
	}

	public void setProdConceptosPersonals(
			Set<ProdConceptosPersonal> prodConceptosPersonals) {
		this.prodConceptosPersonals = prodConceptosPersonals;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "prodConceptos")
	public Set<ProdConceptosEquipos> getProdConceptosEquiposes() {
		return this.prodConceptosEquiposes;
	}

	public void setProdConceptosEquiposes(
			Set<ProdConceptosEquipos> prodConceptosEquiposes) {
		this.prodConceptosEquiposes = prodConceptosEquiposes;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object entidad) {
		return (entidad instanceof ProdConceptos) ? getConcId() == ((ProdConceptos) entidad).getConcId() : false;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		return getConcId() > 0 ? getConcId() : super.hashCode();
	}

}
